package com.changgou.user.feign;

import com.changgou.user.pojo.User;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: wzw
 * @Date: 2020/12/22 23:00
 * @version: 1.8
 */
@FeignClient(name = "user")//开启feign客户端
@RequestMapping("/user")//映射路径:和被调用功能模块一致
public interface UserFeign {
    /**
     * @author wzw
     * 和user模块中的方法一致:查询一条数据
     * @Date 23:02 2020/12/22
     * @param id 账号
     * @return Result<User>
    **/
    @GetMapping(value = {"/{id}"})
    Result<User> findById(@PathVariable(value = "id") String id);
}
